package com.wang.designpattern.factory.reflectSimplefactory.pizzastore.store;

import com.wang.designpattern.factory.reflectSimplefactory.pizzastore.pizza.BJCheesePizza;
import com.wang.designpattern.factory.reflectSimplefactory.pizzastore.pizza.BJGreekPizza;
import com.wang.designpattern.factory.reflectSimplefactory.pizzastore.pizza.BJPepperPizza;
import com.wang.designpattern.factory.reflectSimplefactory.pizzastore.pizza.Pizza;

/**
 * 北京工厂类
 */
public class BJPizzaFactory extends PizzaFactory {

    @Override
    public Pizza createOrder(String orderType) {
        System.out.println("北京工厂");
        Pizza pizza = null;
        if (orderType.equals("cheese")) {
            pizza = new BJCheesePizza();
            pizza.setName("北京奶酪披萨");
        } else if (orderType.equals("greek")) {
            pizza = new BJGreekPizza();
            pizza.setName("北京希腊披萨");
        } else if (orderType.equals("pepper")) {
            pizza = new BJPepperPizza();
            pizza.setName("北京胡椒披萨");
        }
        return pizza;
    }
}